package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GroupPurchasePackageItemMapper;
import com.ruoyi.system.domain.GroupPurchasePackageItem;
import com.ruoyi.system.service.IGroupPurchasePackageItemService;

/**
 * 团购套餐包含的商品Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class GroupPurchasePackageItemServiceImpl implements IGroupPurchasePackageItemService
{
    @Autowired
    private GroupPurchasePackageItemMapper groupPurchasePackageItemMapper;

    /**
     * 通过id查询团购套餐包含的商品
     *
     * @param id 团购套餐包含的商品主键
     * @return 团购套餐包含的商品
     */
    @Override
    public GroupPurchasePackageItem selectGroupPurchasePackageItemById(Long id)
    {
        return groupPurchasePackageItemMapper.selectGroupPurchasePackageItemById(id);
    }

    /**
     * 查询团购套餐包含的商品列表
     *
     * @param groupPurchasePackageItem 团购套餐包含的商品
     * @return 团购套餐包含的商品
     */
    @Override
    public List<GroupPurchasePackageItem> selectGroupPurchasePackageItemList(GroupPurchasePackageItem groupPurchasePackageItem)
    {
        return groupPurchasePackageItemMapper.selectGroupPurchasePackageItemList(groupPurchasePackageItem);
    }

    /**
     * 新增团购套餐包含的商品列表
     *
     * @param groupPurchasePackageItem 团购套餐包含的商品
     * @return 结果
     */
    @Override
    public int insertGroupPurchasePackageItem(GroupPurchasePackageItem groupPurchasePackageItem)
    {
        return groupPurchasePackageItemMapper.insertGroupPurchasePackageItem(groupPurchasePackageItem);
    }

    /**
     * 修改团购套餐包含的商品列表
     *
     * @param groupPurchasePackageItem 团购套餐包含的商品
     * @return 结果
     */
    @Override
    public int updateGroupPurchasePackageItem(GroupPurchasePackageItem groupPurchasePackageItem)
    {
        return groupPurchasePackageItemMapper.updateGroupPurchasePackageItem(groupPurchasePackageItem);
    }

    /**
     * 批量删除团购套餐包含的商品列表
     *
     * @param ids 需要删除的团购套餐包含的商品主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchasePackageItemByIds(Long[] ids)
    {
        return groupPurchasePackageItemMapper.deleteGroupPurchasePackageItemByIds(ids);
    }

    /**
     * 删除团购套餐包含的商品信息列表
     *
     * @param id 团购套餐包含的商品主键
     * @return 结果
     */
    @Override
    public int deleteGroupPurchasePackageItemById(Long id)
    {
        return groupPurchasePackageItemMapper.deleteGroupPurchasePackageItemById(id);
    }
}
